-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check silentMode in errors on the same level as task.silent #3626
check silentMode in errors on the same level as task.silent #3626
Conversation
core/lib/sync/task.ts
Outdated
const message = typeof jsonResponse.result === 'string' ? jsonResponse.result : typeof jsonResponse.result.result === 'string' ? jsonResponse.result.result : jsonResponse.result.message | ||
|
||
const errorMessage = isObject(jsonResponse.result) ? (jsonResponse.result.result || jsonResponse.result.message) : jsonResponse.result | ||
const errorCode = isObject(jsonResponse.result) ? jsonResponse.result.code : jsonResponse.code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not to sure about this jsonRespone.code
but let me analyse that 😄
try with this:
and put these function on the top of the file, now these conditions will be more readable, feel free to improve that, and please test if it works as previously. Would be nice to move this to the helpers and write some unit test |
…com:gibkigonzo/vue-storefront into bugfix/check-silentMode-same-as-task-silent
@andrzejewsky thanks, I've applied your suggestions :) |
Thanks for the fast reaction everyone! I like the cleanup of the code you did while fixing this. Looks good! |
…com:gibkigonzo/vue-storefront into bugfix/check-silentMode-same-as-task-silent
Related issues
closes #3621
Short description and why it's useful
with this change
silentMode
will be checked on the same level astask.silent
Which environment this relates to
Check your case. In case of any doubts please read about Release Cycle
develop
branch and want to merge it back todevelop
release
branch and want to merge it back torelease
hotfix
ormaster
branch and want to merge it back tohotfix
Upgrade Notes and Changelog
IMPORTANT NOTICE - Remember to update
CHANGELOG.md
with description of your changeContribution and currently important rules acceptance